package com.golddaymicromall.activity.profit;

import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.golddaymicromall.activity.R;
import com.golddaymicromall.base.BaseActivity;
import com.golddaymicromall.util.DateFormatUtils;
import com.golddaymicromall.util.SPUtils;

public class ProfitDetailActivity extends BaseActivity implements View.OnClickListener {
    Bundle bundle = new Bundle();
    private TextView zhouqishu;
    private TextView jiesuanshijian;
    private TextView dianpubianhao;
    private TextView jiamengleixing;
    private TextView guanlizhiji;
    private TextView danqishouqi;
    private TextView fuchishouyi;
    private TextView fuwushouyi;
    private TextView zhuoyueshouyi;
    private TextView dangqishouyi;
    private TextView yugoudaikuan;

    private TextView kaifashouyi;
    private TextView rongyaoshouyi;
    private TextView shijishouru;
    private TextView dangqijifenzonghe;
    private LinearLayout mProfitDetailsBack;
    private LinearLayout mshouyi_dangqishouqi;
    private LinearLayout mshouyi_fuchishouyi;
    private LinearLayout mshouyi_kaifashouyi;
    private LinearLayout mshouyi_rongyaoshouyi;
    private LinearLayout mshouyi_fuwushouyi;
    private LinearLayout mshouyi_zhuoyueshouyi;
    DateFormatUtils dateFormatUtils;
    private String OrganizationId;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_profit_detail);
        OrganizationId = SPUtils.get(getApplicationContext(), "OrganizationId", "").toString();
        initView();
    }

    public void initView() {
        zhouqishu = (TextView) findViewById(R.id.profit_zhouqishu);
        jiesuanshijian = (TextView) findViewById(R.id.profit_jiesuanshijian);
        dianpubianhao = (TextView) findViewById(R.id.profit_dianpubianhao);
        jiamengleixing = (TextView) findViewById(R.id.profit_jiamengleixing);
        guanlizhiji = (TextView) findViewById(R.id.profit_guanlizhiji);
        danqishouqi = (TextView) findViewById(R.id.profit_danqishouqi);
        fuchishouyi = (TextView) findViewById(R.id.profit_fuchishouyi);
        fuwushouyi = (TextView) findViewById(R.id.profit_fuwushouyi);
        zhuoyueshouyi = (TextView) findViewById(R.id.profit_zhuoyueshouyi);
        dangqishouyi = (TextView) findViewById(R.id.profit_dangqishouyi);
        yugoudaikuan = (TextView) findViewById(R.id.profit_yugoudaikuan);
        shijishouru = (TextView) findViewById(R.id.profit_shijishouru);
        dangqijifenzonghe = (TextView) findViewById(R.id.profit_dangqijifenzonghe);

        kaifashouyi=(TextView) findViewById(R.id.profit_kaifashouyi);
        rongyaoshouyi=(TextView) findViewById(R.id.profit_rongyaoshouyi);

        mshouyi_dangqishouqi = (LinearLayout) findViewById(R.id.shouyi_dangqishouqi);
        mshouyi_fuchishouyi = (LinearLayout) findViewById(R.id.shouyi_fuchishouyi);
        mshouyi_fuwushouyi = (LinearLayout) findViewById(R.id.shouyi_fuwushouyi);
        mshouyi_zhuoyueshouyi = (LinearLayout) findViewById(R.id.shouyi_zhuoyueshouyi);
        mshouyi_kaifashouyi = (LinearLayout) findViewById(R.id.shouyi_kaifashouyi);
        mshouyi_rongyaoshouyi = (LinearLayout) findViewById(R.id.shouyi_rongyaoshouyi);
        if(OrganizationId.equals("28")){
            mshouyi_dangqishouqi.setVisibility(View.GONE);
            mshouyi_fuchishouyi.setVisibility(View.GONE);
            mshouyi_fuwushouyi.setVisibility(View.GONE);
            mshouyi_zhuoyueshouyi.setVisibility(View.GONE);
            mshouyi_kaifashouyi.setVisibility(View.GONE);
            mshouyi_rongyaoshouyi.setVisibility(View.GONE);
        }

        bundle = getIntent().getExtras();
        zhouqishu.setText(bundle.getString("zhouqishu"));
        jiesuanshijian.setText(dateFormatUtils.dateFormat2(bundle.getString("jiesuanshijian")));
        dianpubianhao.setText(bundle.getString("dianpubianhao"));
        jiamengleixing.setText(bundle.getString("jiamengleixing"));
        guanlizhiji.setText(bundle.getString("guanlizhiji"));
        danqishouqi.setText(bundle.getString("danqishouqi"));
        fuchishouyi.setText(bundle.getString("fuchishouyi"));
        fuwushouyi.setText(bundle.getString("fuwushouyi"));
        zhuoyueshouyi.setText(bundle.getString("zhuoyueshouyi"));
        dangqishouyi.setText(bundle.getString("dangqishouyi"));
        yugoudaikuan.setText(bundle.getString("yugoudaikuan"));
        shijishouru.setText(bundle.getString("shijishouru"));
        kaifashouyi.setText(bundle.getString("kaifashouyi"));
        kaifashouyi.setText(bundle.getString("kaifashouyi"));
        rongyaoshouyi.setText(bundle.getString("rongyaoshouyi"));
        dangqijifenzonghe.setText(bundle.getString("Allinte"));
        mProfitDetailsBack = (LinearLayout) findViewById(R.id.profitDetail_back);
        mProfitDetailsBack.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.profitDetail_back:
                finish();
                break;
        }
    }
}
